/*
public class Test {

    //从子串的pos位置开始匹配，找到字串在主串当中的下标
    public static int KMP(String str,String sub, int pos){
        if(str == null || sub == null) return -1;
        int lenStr = str.length();
        int lenSub = sub.length();
        if(lenStr == 0 || lenSub == 0) return -1;
        if(pos < 0 || pos >= lenStr) return -1;

        int [] next = new int[lenSub];
        getNext(sub,next);

        int i = pos;  //遍历主串
        int j = 0;    //遍历子串

        while(i < lenStr && j < lenSub){
            // j == -1 一开始就匹配失败
            if(j == -1 || str.charAt(i) == sub.charAt(j)){
                i++;
                j++;
            }else {
                j = next[j];  //不相等就回退
            }
        }
        if(j >= lenSub){
            return i - j;
        }
        return -1;
    }

    public static void getNext(String sub, int [] next){
        next[0] = -1;
        next[1] = 0;
        int i = 2;
        int k = 0;
        //遍历子串
        for (; i < sub.length(); i++) {
            if(k == -1 || sub.charAt(i-1) == sub.charAt(k)){
                next[i] = k+1;
                k++;
                i++;
            }else{
                k = next[k];
            }
        }
    }

    public static void main(String[] args) {
        System.out.println(KMP("abababacd", "bacd", 0));
        System.out.println(KMP("abababacd", "abab", 0));
    }
}
*/
/*

public class Test {
    public static int Sum(int n){
        if(n<10){
            return n;
        }
       return n%10+Sum(n/10);

    }

    public static void main(String[] args) {
        int ret=Sum(12);
        System.out.println(ret);
    }
}
*/

/*

public class Test {
    public static int fib(int n){
        if(n==1||n==2){
            return 1;
        }
        return fib(n-1)+fib(n-2);
    }
    public static void main(String[] args){
        int ret = fib(45);
        System.out.println(ret);
    }
}
*/

/*public class Test {
    public static int fac(int n){
        if(n==1){
            return 1;
        }
        return n*fac(n-1);
    }
    public static void main(String[] args) {
        int ret=fac(5);
        System.out.println(ret);
    }
}*/
/*
public class Test{
    public static void Print(int n){
        if(n>=10) {
            Print(n / 10);
        }
        System.out.print(n%10+" ");
    }
    public static void main(String[] args) {
        Print(1234567);
    }
}*/

/*
public class Test{
    public static int add(int n){
        if(n<10) {
            return n;
        }
        return n%10+add(n/10);
    }
    public static void main(String[] args) {
        int ret=add(123);
        System.out.println(ret);
    }
}*/
/*

public class Test {
    public static void main(String[] args) {
        */
/*int [] array = {3,4,5,6};

        int [] array2 = new int[]{1,2,3,4};

        int [] array3 = new int[10];//默认会将数组初始化为0

        int len = array.length;
        System.out.println(len);*//*
       */
/* int n = 10;
        int array[] = new int[n];

        array[3]=33;
        array[4]=88;*//*
        */
/*int []array;
        array = null;
        System.out.println(array);*//*
        //boolean[] array=new boolean [10];
        int []array={1,2,3,4,5};
       */
/* for (int i = 0; i < array.length; i++) {
            System.out.print(array[i]+" ");
        }*//*
        //增强for循环
        for (int x:array) {
             System.out.println(x);
        }
    }
}
*/
/*
public class Test {
    public static void main(String[] args) {
        *//*int []arr=new int[]{1,2,3,34,45,5,6};
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        int []array={1,2,3,4,5,6,7};
        for (int x:array
             ) {
            System.out.println(x);
        }
        int [] array2 = null;
        System.out.println(array2.length);*//*

        int [] array = {11,22,33,44,55,66,77};
        int [] array2 = array;
        for (int i = 0; i < array2.length; i++) {
            System.out.print(array2[i]+" ");
            System.out.print(array[i]+" ");
        }
    }
}*/
/*
public class Test {
    public static void func1(int []array){
        array[0] = 99;
    }
    public static void func2(int []array){
        array = new int[]{11,22,33,44,55};
    }
    public static int []func3(){
        int [] ret = new int[2];
        ret[0] = 99;
        ret[1] = 199;
        return ret;
    }
    public static void main(String[] args) {
       int[] ret = func3();
       for(int x:ret){
           System.out.print(x+" ");
       }
    }
}*/
/*

import java.util.Arrays;
public class Test{
    public static void main(String[] args){
        int[] array={};
        int[] array2=null;
        //Arrays.sort(array,0,3);
        System.out.println(myToString(array));
    }

    public static String myToString(int[] array){
        if(array == null){
            return null;
        }
        if(array.length == 0){
            return "[]";
        }
        String ret = "[";
        for (int i = 0; i < array.length; i++) {
            ret += array[i];
            if(i < array.length - 1) {
                ret += ", ";
            }
        }
        ret += "]";
        return ret;
    }
}
*/
/*

import java.util.Arrays;

public class Test {
    //冒泡排序
    public static void bubbleSort(int[] array){
        for (int i = 0; i < array.length - 1; i++) {
            boolean flag = true;
            for (int j = 0; j < array.length - i - 1; j++) {
                if(array[j] > array[j + 1]){
                    int tmp = array[j];
                    array[j] = array[j+1];
                    array[j+1] = tmp;
                    flag = false;
                }
            }
            //优化
            if(flag == true){
                break;
            }
        }
    }

    public static void reverse(int[] array){
        for(int i = 0, j = array.length - 1;i < j; i++,j--){
            int tmp = array[i];
            array[i] = array[j];
            array[j] = tmp;
        }
    }

    public static void main(String[] args){
        int[] arr = {21,21,4,3,1,2,43,121,453,32,12,45,3,23,43,32};
        bubbleSort(arr);
        reverse(arr);
        String ret = Arrays.toString(arr);
        System.out.println(ret);
    }
}

*/
/*

public class Test{
    public static void main(String[] args){
        int[] arr={1,2,3};
        transform(arr);
        for(int x:arr){
            System.out.print(x+" ");
        }
    }
    public static void transform(int[]array){
        for (int i = 0; i < array.length; i++) {
            array[i]*=2;
        }
    }
}
*/
/*
public class Test {
    public static void main(String[] args) {
        int []arr={1,2,3,4,5,6};
        fac(arr);
        for(int x:arr){
            System.out.print(x+" ");
        }
    }
    public static void fac(int[] array){
        int i = 0;
        int j = array.length - 1;
        while(i < j){
            //找到左边的偶数
            while(array[i] % 2 == 1 && i < j){
                i++;
            }
            //找到右边的奇数
            while(array[j] % 2 == 0 && i < j){
                j--;
            }
            //交换
            int tmp = array[i];
            array[i] = array[j];
            array[j] = tmp;
        }
    }
}*/

//二分查找
/*

public class Test{
    public static void main(String[] args){
        int[]arr={1,2,3,4,5,6,7,8,9,10};
        int ret= binarySearch(arr,5);
        System.out.println(ret);
    }
    public static int binarySearch(int[]array,int x){
        int left = -1;
        int right = array.length;
        while(left + 1 != right){
            int mid = (right + left)/2;
            if(array[mid]<x){
                left = mid;
            }else if(array[mid]>x){
                right = mid;
            }else {
                return mid;
            }
        }
        return -1;
    }
}
*/
/*
public class Test {
    public static void main(String[] args) {
        int []arr={2,7,11,15};
        int []arr2=search(arr,9);
        System.out.printf("%d %d\n",arr2[0],arr2[1]);
    }

    public static int[] search(int[]array,int target){
        for (int i = 0; i < array.length; i++) {
            for (int j = i+1; j < array.length; j++) {
                if(array[i] + array[j] == target){
                    int []arr={i,j};
                    return arr;
                }
            }
        }
        return null;
    }
}*/
/*

public class Test {
    public static void main(String[] args) {
        int[] arr={4,1,2,1,2};
        int ret = find(arr);
        System.out.println(ret);
    }
    public static int find(int[]array){
        for (int i = 0; i < array.length; i++) {
            int count=0;
            for (int j = i+1; j < array.length; j++) {
                if(array[i]==array[j]){
                    count++;
                }
            }
            if(count==0){
                return array[i];
            }
        }
        return -1;
    }
}
*/

public class Test {
    public static void main(String[] args) {
        int[] arr={1,2,34,3,4,5,7,23,12};
        boolean ret= check(arr);
        System.out.println(ret);
    }
    public static boolean check(int[] array){
        for(int i=0;i<array.length-3;i++){
            if(array[i]%2==1&&array[i+1]%2==1&&array[i+2]%2==1){
                return true;
            }
        }
        return false;
    }
}





















